package org.wak.utils
{
	public class ArrayIterator implements IIterator
	{
		private var mCurrentIndex:int = 0
		private var mStateArray:Array
		
		public function ArrayIterator(pStateArray:Array)
		{
			if(pStateArray != null)
			{
				mStateArray = pStateArray
			}
			else
			{
				throw new Error("You can't iterate through a null Array.");
			}	
			
				
		}
		
		public function remove():void
		{
		}
		
		public function hasNext():Boolean
		{
			if( mCurrentIndex < mStateArray.length )
			{
				return true 			
			}
			else
			{
				return false
			}
				
		}
		
		public function next():Object
		{
			var fTempObject:Object = mStateArray[ mCurrentIndex ];
			mCurrentIndex++
			return fTempObject			
		}
		
	}
}